<%@ include file="header.jsp"%>
<%@page import="java.util.List"%>
<%@page import="database.DBClass"%>
<%@page import="model.AnggotaBean"%>

<% AnggotaBean bean = new AnggotaBean();
    //get request from servlet if data is invalid

    if (request.getAttribute("updateuser") != null) {
        bean = (AnggotaBean) request.getAttribute("updateuser");
    }
%>

<!-- start: Content -->
<div id="content" class="span10">


    <ul class="breadcrumb">
        <li>
            <i class="icon-home"></i>
            <a href="index.jsp">Home</a>
            <i class="icon-angle-right"></i> 
        </li>
        <li>
            <i class="icon-edit"></i>
            <a href="#">Forms</a>
        </li>
    </ul>



    <div class="row-fluid sortable">
        <div class="box span12">
            <div class="box-header" data-original-title>
                <h2><i class="halflings-icon edit"></i><span class="break"></span>Form Anggota</h2>

            </div>
            <div class="box-content">
                <form class="form-horizontal" method="post" action="AnggotaServlet">
                    <fieldset>

                        <div class="control-group success">

                            <div class="controls">
                                <input class="input-xlarge" type="hidden" id="id" name="id" value="<%=bean.getAnggotaId()%>" <%=request.getAttribute("updateuser") != null ? "readonly" : ""%>>

                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="nama">Nama:</label>
                            <div class="controls">
                                <input class="input-xlarge" data-validation="required" data-validation-error-msg="Nama harus diisi" type="text" id="nama" name="nama" value="<%=bean.getNama()%>">

                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="inputSuccess">Alamat:</label>
                            <div class="controls">
                                <input class="input-xlarge" data-validation="required" data-validation-error-msg="Alamat harus diisi" type="text" id="alamat" name="alamat" value="<%=bean.getAlamat()%>">

                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="ttl">Tanggal lahir:</label>
                            <div class="input-group date form_date controls" data-date-format="yyyy-mm-dd" data-link-format="yyyy-mm-dd">
                                <input class="input-xlarge"  data-validation="birthdate" data-validation-help="yyyy-mm-dd" data-validation-error-msg="Tanggal lahir harus diisi" size="16" type="text" id="ttl" name="ttl" placeholder="Tanggal lahir" value="<%=bean.getTanggalLahir()%>">
                                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                            </div>

                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="kelamin">Kelamin:</label>
                            <div class="controls">
                                <select id="kelamin" name="kelamin" data-rel="chosen" data-validation="required" data-validation-error-msg="Kelamin harus dipilih" >
                                    <option value="<%=bean.getKelamin()%>"><%=bean.getNamaKelamin()%></option>
                                    <option value="1">Laki-laki</option>
                                    <option value="2">Perempuan</option>
                                </select>
                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="inputSuccess">Telepon:</label>
                            <div class="controls">
                                <input class="input-xlarge" data-validation="required number" data-validation-length="12" data-validation-error-msg="Nomor telepon harus diisi dengan 12 digit angka" type="text" id="telepon" name="telepon" value="<%=bean.getTelp()%>">
                               
                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="inputSuccess">Pekerjaan:</label>
                            <div class="controls">
                                <input class="input-xlarge" data-validation="required" type="text" id="pekerjaan" name="pekerjaan" data-validation-error-msg="Pekerjaan harus diisi" value="<%=bean.getPekerjaan()%>">
                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="agama">Agama:</label>
                            <div class="controls">
                                <select id="agama" name="agama" data-rel="chosen" data-validation="required" data-validation-error-msg="Agama harus dipilih">
                                    <option value="<%=bean.getAgama()%>"><%=bean.getNamaAgama()%></option>
                                    <option value="1">Islam</option>
                                    <option value="2">Kristen</option>
                                    <option value="3">Katolik</option>
                                    <option value="4">Hindu</option>
                                    <option value="5">Buddha</option>


                                </select>
                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="inputSuccess">Iuran:</label>
                            <div class="controls">
                                <input class="input-xlarge" data-validation="required number" data-validation-error-msg="Iuran harus diisi dengan angka" type="text" id="iuran" name="iuran" value="<%=bean.getTelp()%>">
                            </div>
                        </div>          
                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary" name="action" value="<%=bean.getAction()%>"><%=bean.getAction()%></button>
                            <input type="reset" class="btn" value="Cancel">
                        </div>
                    </fieldset>
                </form>
                

            </div>
        </div><!--/span-->

    </div><!--/row-->




</div><!--/.fluid-container-->

<!-- end: Content -->
</div><!--/#content.span10-->
</div><!--/fluid-row-->

<%@ include file="footer.jsp"%>